package com.example.xmind2testcase.controller;

import com.example.xmind2testcase.util.R;
import org.springframework.http.HttpEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
public class UserManageController {

    @PostMapping("/user/login")
    public R userLogin(){
        HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
        objectObjectHashMap.put("token","admin-token");

        return R.ok(objectObjectHashMap);
    }


    @GetMapping("/user/info")
    public R  userInfo(){
        HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
        String[] list = {"admin"};
        objectObjectHashMap.put("roles",list);
        return R.ok(objectObjectHashMap);
    }
}
